package com.iuie.ns.system.controller.mq;

import javax.annotation.Resource;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.iuie.ns.frame.web.response.vo.ResponseInfo;
import com.iuie.ns.system.service.ITextMessageProducerService;

/**
 * 发送简单
 * @author iuie
 * @date 2017-09-07 10:17:14
 */
@Controller
@RequestMapping("mq")
public class TextMessageQueueController {

	@Resource
	private ITextMessageProducerService producerService;
	
	/**
	 * 发送文本 消息
	 * @param message
	 * @return
	 */
	@RequestMapping("text/{message}/send")
	@ResponseBody
	public ResponseInfo sendMessage(@PathVariable("message") String message) {
		producerService.sendMessage("test_mq_exchange", "test_mq_patt", message);
		return ResponseInfo.successInfo("消息发送成功！");
	}
	
}
